Guard chart components against null streaming data#487
Conversation
ankit-thesys
left a comment
There was a problem hiding this comment.
Changes look good. Can you fix the build issue? You are good to go with this PR.
|
Fixed the build issue and pushed an update to this PR. Root cause was a Prettier failure in two chart files touched by this change. Latest commit: Please recheck when you get a chance. |
|
Just read the issue. Have you tried the solution suggested there? |
|
Updated this PR to follow your suggestion. I moved the runtime guard out of the chart component library and into What changed in this update:
Latest commit: Validation on my side:
I couldn't run the full workspace typecheck/build here because this environment doesn't have the repo toolchain installed, but the PR is now aligned with the renderer/consumer approach you mentioned. Please recheck when you get a chance. |
|
Hey! First of all, thank you for taking the time to put this PR together — we genuinely appreciate the contribution and the effort that went into it. After carefully reviewing the PR and discussing it with the React Renderer maintainers, we’ve decided to address this by adding guards for nullish data on the renderer side in the react-lang package. Since that approach resolves the issue at the source, we won’t be moving forward with this PR. That said, your contribution was genuinely helpful — it surfaced the issue clearly and gave us the push to investigate and fix it in what we believe is the right place. We really appreciate you taking the initiative here, and hope you’ll continue contributing in the future. |
Summary
ensureChartData()helper that normalizesnull/undefinedchart data to[]Why this fix
The chart schemas in current
mainalready require the expected fields, but that still doesn't fully protect the runtime streaming path when partial data reaches the components before the payload is complete. This PR adds the missing runtime safety layer without changing the public API.Validation
git diff --checkdataprop fromensureChartData(...)Closes #355.